﻿//////////////////////////////////////////////////////////////////////////////
//
//  Copyright © 1998-2024 Glodon Company Limited.  All rights reserved.
//
//  Use of this software is subject to the terms of the Glodon license
//  agreement provided at the time of installation or download, or which
//  otherwise accompanies this software in either electronic or hard copy form.  
//
//////////////////////////////////////////////////////////////////////////////


#pragma once
#include "GcmpModelInterface.h"
#include "IDbObject.h"

namespace gcmp
{
    class IInstance;

    /// \brief 图形表达验证接口类
    class GCMP_MODEL_INTERFACE_EXPORT IBaseGraphicsElementShapeValidiator : public IDbObject
    {
        DEFINE_CAST_DERIVED(gcmp::IBaseGraphicsElementShapeValidiator, gcmp::IDbObject);
    public:

        /// \brief 验证接口,会在基础图形表达计算之前验证
        ///
        /// 当验证不通过时，若使用平台提供的默认提示窗口，可将错误信息写入pErrorMessage中。
        /// 否则不要在pErrorMessage中写入数据。
        ///
        /// \param pInstance  待验证element图形表达所在Instance
        /// \param pErrorMessage 传出参数, 错误信息。
        /// \return bool true 验证通过，false 验证不通过
        virtual bool ValidateBeforeCalculation(const IInstance* pInstance, std::wstring* pErrorMessage) const = 0;
     };
}



